#include <iostream>
using namespace std;
const int M = 40;
const int N = 40;
int A[N][M];

int main()
{
	int n, r, c, s=1;
	cin >> n;
	n = 2 * n - 1;
	r = 0;
	c = n / 2;
	A[r][c] = s++;
	while (s <= n*n)
	{
		if ((r == 0 && c == n-1) || (r>0 && c<n-1 && A[r-1][c+1] != 0))
		{
			r = r + 1;
			A[r][c] = s++;
		}
		else if (r == 0 && c < n-1)
		{
			r = n -1;
			c = c + 1;
			A[r][c] = s++;
		}
		else if (c == n-1)
		{
			r = r -1;
			c = 0;
			A[r][c] = s++;
		}
		else
		{
			r = r -1;
			c = c + 1;
			A[r][c] = s++;
		}
	}
	for (int i=0; i<n; i++)
	{
		for (int j=0; j<n; j++)
		{
			cout << A[i][j] << " ";
		}
		cout << endl;
	}

}